<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo CON_PLATFORMNAME;?>后台管理系统</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<script src="/static/js/jquery.js"></script>
<link href="/static/admin/style.css" rel="stylesheet" media="screen" type="text/css" />
</head>
<body>
<div class="login_logo">
<img src="/static/admin/login-logo.png">
</div>
<!-- Login Logo end -->
<div class="login_login">
<form action="" method="post" id="loginForm" name="loginForm">
<input type="hidden" id="last_url" name="last_url" value="<?php echo $last_url;?>"/>
<ul>
<li><p id="msg" style="text-align:center;color:red">&nbsp;</p></li>
<li><div class="login_login_left">用户名：</div><div class="login_login_right"><input type="text" id="username" name="username" style="width:145px;" maxlength="20"></div></li>
<li><div class="login_login_left">密码：</div><div class="login_login_right"><input type="password" id="password" name="password" style="width:145px;" maxlength="20"></div></li>
<!--<li><div class="login_login_left">短信码：</div><div class="login_login_right"><input type="text" id="smscode" name="smscode" style="width:145px;" maxlength="20"><a href='javascript:send_smscode();'>发送短信</a></div></li>-->
<li><div class="login_login_left">验证码：</div><div class="login_login_right"><input type="text" id="captcha" name="captcha" style="width:45px;" maxlength="4"><img src="/yanzheng/index/" id="imgCode" onclick="changeImage();"/></div></li>
</ul>
</form>
<div class="login_btn">
<input type="image" id="login_btn" src="/static/admin/login_btn.png" onclick="login_submit()" /> </div>
</div>
<!-- Login Login end -->
<div class="login_login_footer">Copyright © 2013 <?php echo COMPANY_NAME;?> All Rights Reserved.</div>
<!-- Login Footer end -->
<script type="text/javascript">
function login_submit(){
	$.ajax({
			type: "POST",
			url: "/ychadmin/login",
			data: "act=login&username="+$('#username').val()+"&password="+$('#password').val()+"&captcha="+$('#captcha').val()+"&last_url="+$('#last_url').val(),
			success: function(ret){
				if(ret.msg != ""){
					$("#msg").html(ret.msg);
					changeImage();
					setTimeout(function(){
						$("#msg").html("&nbsp;");
					},3000);
				}else{
					window.location=ret.url;
				}
			},
			dataType: "json"
		});
}

function changeImage() {
	document.getElementById("imgCode").src = "/yanzheng/index/?" + Math.random();
}

$("input").keyup(function(e){
if(e.keyCode==13){
   login_submit();
}
}); 

</script>
</body>
</html>
